/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('lto', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddBaaSAntChainBizChainRequest {
  baaSAntChainChainId?: string(name='BaaSAntChainChainId'),
  baaSAntChainConsortiumId?: string(name='BaaSAntChainConsortiumId'),
  caCert?: string(name='CaCert'),
  caCertPassword?: string(name='CaCertPassword'),
  clientCert?: string(name='ClientCert'),
  clientKey?: string(name='ClientKey'),
  clientKeyPassword?: string(name='ClientKeyPassword'),
  contractTemplateIdList?: string(name='ContractTemplateIdList'),
  name?: string(name='Name'),
  nodeNameList?: string(name='NodeNameList'),
  remark?: string(name='Remark'),
  userKey?: string(name='UserKey'),
  userKeyPassword?: string(name='UserKeyPassword'),
  userName?: string(name='UserName'),
}

model AddBaaSAntChainBizChainResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddBaaSAntChainBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: AddBaaSAntChainBizChainResponseBody(name='body'),
}

async function addBaaSAntChainBizChainWithOptions(request: AddBaaSAntChainBizChainRequest, runtime: Util.RuntimeOptions): AddBaaSAntChainBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.baaSAntChainChainId)) {
    query['BaaSAntChainChainId'] = request.baaSAntChainChainId;
  }
  if (!Util.isUnset(request.baaSAntChainConsortiumId)) {
    query['BaaSAntChainConsortiumId'] = request.baaSAntChainConsortiumId;
  }
  if (!Util.isUnset(request.caCert)) {
    query['CaCert'] = request.caCert;
  }
  if (!Util.isUnset(request.caCertPassword)) {
    query['CaCertPassword'] = request.caCertPassword;
  }
  if (!Util.isUnset(request.clientCert)) {
    query['ClientCert'] = request.clientCert;
  }
  if (!Util.isUnset(request.clientKey)) {
    query['ClientKey'] = request.clientKey;
  }
  if (!Util.isUnset(request.clientKeyPassword)) {
    query['ClientKeyPassword'] = request.clientKeyPassword;
  }
  if (!Util.isUnset(request.contractTemplateIdList)) {
    query['ContractTemplateIdList'] = request.contractTemplateIdList;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nodeNameList)) {
    query['NodeNameList'] = request.nodeNameList;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.userKey)) {
    query['UserKey'] = request.userKey;
  }
  if (!Util.isUnset(request.userKeyPassword)) {
    query['UserKeyPassword'] = request.userKeyPassword;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddBaaSAntChainBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addBaaSAntChainBizChain(request: AddBaaSAntChainBizChainRequest): AddBaaSAntChainBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return addBaaSAntChainBizChainWithOptions(request, runtime);
}

model AddBaaSFabricBizChainRequest {
  baaSFabricChannelId?: string(name='BaaSFabricChannelId'),
  baaSFabricConsortiumId?: string(name='BaaSFabricConsortiumId'),
  baaSFabricOrganizationId?: string(name='BaaSFabricOrganizationId'),
  contractTemplateIdList?: string(name='ContractTemplateIdList'),
  name?: string(name='Name'),
  remark?: string(name='Remark'),
}

model AddBaaSFabricBizChainResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddBaaSFabricBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: AddBaaSFabricBizChainResponseBody(name='body'),
}

async function addBaaSFabricBizChainWithOptions(request: AddBaaSFabricBizChainRequest, runtime: Util.RuntimeOptions): AddBaaSFabricBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.baaSFabricChannelId)) {
    query['BaaSFabricChannelId'] = request.baaSFabricChannelId;
  }
  if (!Util.isUnset(request.baaSFabricConsortiumId)) {
    query['BaaSFabricConsortiumId'] = request.baaSFabricConsortiumId;
  }
  if (!Util.isUnset(request.baaSFabricOrganizationId)) {
    query['BaaSFabricOrganizationId'] = request.baaSFabricOrganizationId;
  }
  if (!Util.isUnset(request.contractTemplateIdList)) {
    query['ContractTemplateIdList'] = request.contractTemplateIdList;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddBaaSFabricBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addBaaSFabricBizChain(request: AddBaaSFabricBizChainRequest): AddBaaSFabricBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return addBaaSFabricBizChainWithOptions(request, runtime);
}

model AddBsnFabricBizChainRequest {
  appCode?: string(name='AppCode'),
  name?: string(name='Name'),
  nodeList?: string(name='NodeList'),
  remark?: string(name='Remark'),
  userCode?: string(name='UserCode'),
}

model AddBsnFabricBizChainResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddBsnFabricBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: AddBsnFabricBizChainResponseBody(name='body'),
}

async function addBsnFabricBizChainWithOptions(request: AddBsnFabricBizChainRequest, runtime: Util.RuntimeOptions): AddBsnFabricBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appCode)) {
    query['AppCode'] = request.appCode;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nodeList)) {
    query['NodeList'] = request.nodeList;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.userCode)) {
    query['UserCode'] = request.userCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddBsnFabricBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addBsnFabricBizChain(request: AddBsnFabricBizChainRequest): AddBsnFabricBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return addBsnFabricBizChainWithOptions(request, runtime);
}

model AddDeviceGroupRequest {
  productKey?: string(name='ProductKey'),
  remark?: string(name='Remark'),
}

model AddDeviceGroupResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddDeviceGroupResponse = {
  headers: map[string]string(name='headers'),
  body: AddDeviceGroupResponseBody(name='body'),
}

async function addDeviceGroupWithOptions(request: AddDeviceGroupRequest, runtime: Util.RuntimeOptions): AddDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.productKey)) {
    query['ProductKey'] = request.productKey;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddDeviceGroup',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addDeviceGroup(request: AddDeviceGroupRequest): AddDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addDeviceGroupWithOptions(request, runtime);
}

model AddMemberRequest {
  authorizedCount?: long(name='AuthorizedCount'),
  contactor?: string(name='Contactor'),
  name?: string(name='Name'),
  remark?: string(name='Remark'),
  telephony?: string(name='Telephony'),
  uid?: string(name='Uid'),
}

model AddMemberResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddMemberResponse = {
  headers: map[string]string(name='headers'),
  body: AddMemberResponseBody(name='body'),
}

async function addMemberWithOptions(request: AddMemberRequest, runtime: Util.RuntimeOptions): AddMemberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizedCount)) {
    query['AuthorizedCount'] = request.authorizedCount;
  }
  if (!Util.isUnset(request.contactor)) {
    query['Contactor'] = request.contactor;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.telephony)) {
    query['Telephony'] = request.telephony;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddMember',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addMember(request: AddMemberRequest): AddMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return addMemberWithOptions(request, runtime);
}

model AddPrivacyRuleRequest {
  algImpl?: string(name='AlgImpl'),
  algType?: string(name='AlgType'),
  name?: string(name='Name'),
  remark?: string(name='Remark'),
}

model AddPrivacyRuleResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddPrivacyRuleResponse = {
  headers: map[string]string(name='headers'),
  body: AddPrivacyRuleResponseBody(name='body'),
}

async function addPrivacyRuleWithOptions(request: AddPrivacyRuleRequest, runtime: Util.RuntimeOptions): AddPrivacyRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.algImpl)) {
    query['AlgImpl'] = request.algImpl;
  }
  if (!Util.isUnset(request.algType)) {
    query['AlgType'] = request.algType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddPrivacyRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addPrivacyRule(request: AddPrivacyRuleRequest): AddPrivacyRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return addPrivacyRuleWithOptions(request, runtime);
}

model AddRouteRuleRequest {
  bizChainId?: string(name='BizChainId'),
  contractName?: string(name='ContractName'),
  contractTemplateId?: string(name='ContractTemplateId'),
  deviceGroupId?: string(name='DeviceGroupId'),
  invokeType?: string(name='InvokeType'),
  privacyRuleId?: string(name='PrivacyRuleId'),
  remark?: string(name='Remark'),
}

model AddRouteRuleResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddRouteRuleResponse = {
  headers: map[string]string(name='headers'),
  body: AddRouteRuleResponseBody(name='body'),
}

async function addRouteRuleWithOptions(request: AddRouteRuleRequest, runtime: Util.RuntimeOptions): AddRouteRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainId)) {
    query['BizChainId'] = request.bizChainId;
  }
  if (!Util.isUnset(request.contractName)) {
    query['ContractName'] = request.contractName;
  }
  if (!Util.isUnset(request.contractTemplateId)) {
    query['ContractTemplateId'] = request.contractTemplateId;
  }
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  if (!Util.isUnset(request.invokeType)) {
    query['InvokeType'] = request.invokeType;
  }
  if (!Util.isUnset(request.privacyRuleId)) {
    query['PrivacyRuleId'] = request.privacyRuleId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddRouteRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addRouteRule(request: AddRouteRuleRequest): AddRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return addRouteRuleWithOptions(request, runtime);
}

model AgreeMemberAccessRequest {
  memberAccountId?: string(name='MemberAccountId'),
}

model AgreeMemberAccessResponseBody = {
  code?: string(name='Code', description='Id of the request'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AgreeMemberAccessResponse = {
  headers: map[string]string(name='headers'),
  body: AgreeMemberAccessResponseBody(name='body'),
}

async function agreeMemberAccessWithOptions(request: AgreeMemberAccessRequest, runtime: Util.RuntimeOptions): AgreeMemberAccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.memberAccountId)) {
    query['MemberAccountId'] = request.memberAccountId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AgreeMemberAccess',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function agreeMemberAccess(request: AgreeMemberAccessRequest): AgreeMemberAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return agreeMemberAccessWithOptions(request, runtime);
}

model AuthorizeBaaSResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AuthorizeBaaSResponse = {
  headers: map[string]string(name='headers'),
  body: AuthorizeBaaSResponseBody(name='body'),
}

async function authorizeBaaSWithOptions(runtime: Util.RuntimeOptions): AuthorizeBaaSResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'AuthorizeBaaS',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function authorizeBaaS(): AuthorizeBaaSResponse {
  var runtime = new Util.RuntimeOptions{};
  return authorizeBaaSWithOptions(runtime);
}

model AuthorizeDeviceGroupBizChainRequest {
  bizChainIdList?: string(name='BizChainIdList'),
  deviceGroupId?: string(name='DeviceGroupId'),
}

model AuthorizeDeviceGroupBizChainResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AuthorizeDeviceGroupBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: AuthorizeDeviceGroupBizChainResponseBody(name='body'),
}

async function authorizeDeviceGroupBizChainWithOptions(request: AuthorizeDeviceGroupBizChainRequest, runtime: Util.RuntimeOptions): AuthorizeDeviceGroupBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainIdList)) {
    query['BizChainIdList'] = request.bizChainIdList;
  }
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AuthorizeDeviceGroupBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function authorizeDeviceGroupBizChain(request: AuthorizeDeviceGroupBizChainRequest): AuthorizeDeviceGroupBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return authorizeDeviceGroupBizChainWithOptions(request, runtime);
}

model AuthorizeMemberBizChainRequest {
  bizChainInfo?: string(name='BizChainInfo'),
  memberId?: string(name='MemberId'),
}

model AuthorizeMemberBizChainResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AuthorizeMemberBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: AuthorizeMemberBizChainResponseBody(name='body'),
}

async function authorizeMemberBizChainWithOptions(request: AuthorizeMemberBizChainRequest, runtime: Util.RuntimeOptions): AuthorizeMemberBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainInfo)) {
    query['BizChainInfo'] = request.bizChainInfo;
  }
  if (!Util.isUnset(request.memberId)) {
    query['MemberId'] = request.memberId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AuthorizeMemberBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function authorizeMemberBizChain(request: AuthorizeMemberBizChainRequest): AuthorizeMemberBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return authorizeMemberBizChainWithOptions(request, runtime);
}

model DeletePrivacyRuleRequest {
  privacyRuleId?: string(name='PrivacyRuleId'),
}

model DeletePrivacyRuleResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeletePrivacyRuleResponse = {
  headers: map[string]string(name='headers'),
  body: DeletePrivacyRuleResponseBody(name='body'),
}

async function deletePrivacyRuleWithOptions(request: DeletePrivacyRuleRequest, runtime: Util.RuntimeOptions): DeletePrivacyRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.privacyRuleId)) {
    query['PrivacyRuleId'] = request.privacyRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePrivacyRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deletePrivacyRule(request: DeletePrivacyRuleRequest): DeletePrivacyRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePrivacyRuleWithOptions(request, runtime);
}

model DeleteRouteRuleRequest {
  routeRuleId?: string(name='RouteRuleId'),
}

model DeleteRouteRuleResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteRouteRuleResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteRouteRuleResponseBody(name='body'),
}

async function deleteRouteRuleWithOptions(request: DeleteRouteRuleRequest, runtime: Util.RuntimeOptions): DeleteRouteRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.routeRuleId)) {
    query['RouteRuleId'] = request.routeRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRouteRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRouteRule(request: DeleteRouteRuleRequest): DeleteRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRouteRuleWithOptions(request, runtime);
}

model DeniedMemberAccessRequest {
  memberAccountId?: string(name='MemberAccountId'),
}

model DeniedMemberAccessResponseBody = {
  code?: string(name='Code', description='Id of the request'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeniedMemberAccessResponse = {
  headers: map[string]string(name='headers'),
  body: DeniedMemberAccessResponseBody(name='body'),
}

async function deniedMemberAccessWithOptions(request: DeniedMemberAccessRequest, runtime: Util.RuntimeOptions): DeniedMemberAccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.memberAccountId)) {
    query['MemberAccountId'] = request.memberAccountId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeniedMemberAccess',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deniedMemberAccess(request: DeniedMemberAccessRequest): DeniedMemberAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return deniedMemberAccessWithOptions(request, runtime);
}

model DescribeAccountRoleResponseBody = {
  code?: string(name='Code'),
  data?: {
    authorizedBaaS?: boolean(name='AuthorizedBaaS'),
    roleType?: string(name='RoleType'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeAccountRoleResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeAccountRoleResponseBody(name='body'),
}

async function describeAccountRoleWithOptions(runtime: Util.RuntimeOptions): DescribeAccountRoleResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeAccountRole',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAccountRole(): DescribeAccountRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountRoleWithOptions(runtime);
}

model DescribeBizChainStatInfoResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bizChainName?: string(name='BizChainName'),
      usedCount?: long(name='UsedCount'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeBizChainStatInfoResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeBizChainStatInfoResponseBody(name='body'),
}

async function describeBizChainStatInfoWithOptions(runtime: Util.RuntimeOptions): DescribeBizChainStatInfoResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeBizChainStatInfo',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeBizChainStatInfo(): DescribeBizChainStatInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBizChainStatInfoWithOptions(runtime);
}

model DescribeMemberBizChainStatInfoRequest {
  accountId?: string(name='AccountId'),
}

model DescribeMemberBizChainStatInfoResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bizChainName?: string(name='BizChainName'),
      usedCount?: long(name='UsedCount'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeMemberBizChainStatInfoResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeMemberBizChainStatInfoResponseBody(name='body'),
}

async function describeMemberBizChainStatInfoWithOptions(request: DescribeMemberBizChainStatInfoRequest, runtime: Util.RuntimeOptions): DescribeMemberBizChainStatInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMemberBizChainStatInfo',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeMemberBizChainStatInfo(request: DescribeMemberBizChainStatInfoRequest): DescribeMemberBizChainStatInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMemberBizChainStatInfoWithOptions(request, runtime);
}

model DescribeMemberStatInfoResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      authorizedCount?: long(name='AuthorizedCount'),
      bizChainCount?: int32(name='BizChainCount'),
      memberId?: string(name='MemberId'),
      memberName?: string(name='MemberName'),
      usedCount?: long(name='UsedCount'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeMemberStatInfoResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeMemberStatInfoResponseBody(name='body'),
}

async function describeMemberStatInfoWithOptions(runtime: Util.RuntimeOptions): DescribeMemberStatInfoResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeMemberStatInfo',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeMemberStatInfo(): DescribeMemberStatInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMemberStatInfoWithOptions(runtime);
}

model DescribeMemberTotalStatInfoRequest {
  accountId?: string(name='AccountId'),
}

model DescribeMemberTotalStatInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    authorizedCount?: long(name='AuthorizedCount'),
    usedCount?: long(name='UsedCount'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeMemberTotalStatInfoResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeMemberTotalStatInfoResponseBody(name='body'),
}

async function describeMemberTotalStatInfoWithOptions(request: DescribeMemberTotalStatInfoRequest, runtime: Util.RuntimeOptions): DescribeMemberTotalStatInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMemberTotalStatInfo',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeMemberTotalStatInfo(request: DescribeMemberTotalStatInfoRequest): DescribeMemberTotalStatInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMemberTotalStatInfoWithOptions(request, runtime);
}

model DescribePackgeInfoRequest {
  accountId?: string(name='AccountId'),
}

model DescribePackgeInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    endTime?: long(name='EndTime'),
    startTime?: long(name='StartTime'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribePackgeInfoResponse = {
  headers: map[string]string(name='headers'),
  body: DescribePackgeInfoResponseBody(name='body'),
}

async function describePackgeInfoWithOptions(request: DescribePackgeInfoRequest, runtime: Util.RuntimeOptions): DescribePackgeInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountId)) {
    query['AccountId'] = request.accountId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePackgeInfo',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePackgeInfo(request: DescribePackgeInfoRequest): DescribePackgeInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePackgeInfoWithOptions(request, runtime);
}

model DescribeTotalStatInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    authorizedCount?: long(name='AuthorizedCount'),
    totalCount?: long(name='TotalCount'),
    usedCount?: long(name='UsedCount'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeTotalStatInfoResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeTotalStatInfoResponseBody(name='body'),
}

async function describeTotalStatInfoWithOptions(runtime: Util.RuntimeOptions): DescribeTotalStatInfoResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeTotalStatInfo',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeTotalStatInfo(): DescribeTotalStatInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTotalStatInfoWithOptions(runtime);
}

model DisableDeviceRequest {
  deviceId?: string(name='DeviceId'),
}

model DisableDeviceResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableDeviceResponse = {
  headers: map[string]string(name='headers'),
  body: DisableDeviceResponseBody(name='body'),
}

async function disableDeviceWithOptions(request: DisableDeviceRequest, runtime: Util.RuntimeOptions): DisableDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableDevice',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableDevice(request: DisableDeviceRequest): DisableDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableDeviceWithOptions(request, runtime);
}

model DisableDeviceGroupRequest {
  deviceGroupId?: string(name='DeviceGroupId'),
}

model DisableDeviceGroupResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DisableDeviceGroupResponse = {
  headers: map[string]string(name='headers'),
  body: DisableDeviceGroupResponseBody(name='body'),
}

async function disableDeviceGroupWithOptions(request: DisableDeviceGroupRequest, runtime: Util.RuntimeOptions): DisableDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableDeviceGroup',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableDeviceGroup(request: DisableDeviceGroupRequest): DisableDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableDeviceGroupWithOptions(request, runtime);
}

model DownloadPrivacyKeyResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DownloadPrivacyKeyResponse = {
  headers: map[string]string(name='headers'),
  body: DownloadPrivacyKeyResponseBody(name='body'),
}

async function downloadPrivacyKeyWithOptions(runtime: Util.RuntimeOptions): DownloadPrivacyKeyResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DownloadPrivacyKey',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function downloadPrivacyKey(): DownloadPrivacyKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return downloadPrivacyKeyWithOptions(runtime);
}

model EnableDeviceRequest {
  deviceId?: string(name='DeviceId'),
}

model EnableDeviceResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableDeviceResponse = {
  headers: map[string]string(name='headers'),
  body: EnableDeviceResponseBody(name='body'),
}

async function enableDeviceWithOptions(request: EnableDeviceRequest, runtime: Util.RuntimeOptions): EnableDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableDevice',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableDevice(request: EnableDeviceRequest): EnableDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableDeviceWithOptions(request, runtime);
}

model EnableDeviceGroupRequest {
  deviceGroupId?: string(name='DeviceGroupId'),
}

model EnableDeviceGroupResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EnableDeviceGroupResponse = {
  headers: map[string]string(name='headers'),
  body: EnableDeviceGroupResponseBody(name='body'),
}

async function enableDeviceGroupWithOptions(request: EnableDeviceGroupRequest, runtime: Util.RuntimeOptions): EnableDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableDeviceGroup',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableDeviceGroup(request: EnableDeviceGroupRequest): EnableDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableDeviceGroupWithOptions(request, runtime);
}

model FreezeMemberRequest {
  memberId?: string(name='MemberId'),
}

model FreezeMemberResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FreezeMemberResponse = {
  headers: map[string]string(name='headers'),
  body: FreezeMemberResponseBody(name='body'),
}

async function freezeMemberWithOptions(request: FreezeMemberRequest, runtime: Util.RuntimeOptions): FreezeMemberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.memberId)) {
    query['MemberId'] = request.memberId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FreezeMember',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function freezeMember(request: FreezeMemberRequest): FreezeMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return freezeMemberWithOptions(request, runtime);
}

model ListAllAdminResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      adminId?: string(name='AdminId'),
      name?: string(name='Name'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllAdminResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllAdminResponseBody(name='body'),
}

async function listAllAdminWithOptions(runtime: Util.RuntimeOptions): ListAllAdminResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListAllAdmin',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllAdmin(): ListAllAdminResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllAdminWithOptions(runtime);
}

model ListAllBizChainResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bizChainId?: string(name='BizChainId'),
      name?: string(name='Name'),
      usedOnchainCount?: long(name='UsedOnchainCount'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllBizChainResponseBody(name='body'),
}

async function listAllBizChainWithOptions(runtime: Util.RuntimeOptions): ListAllBizChainResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListAllBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllBizChain(): ListAllBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllBizChainWithOptions(runtime);
}

model ListAllBizChainContractRequest {
  bizChainId?: string(name='BizChainId'),
}

model ListAllBizChainContractResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      contractName?: string(name='ContractName'),
      contractTemplateId?: string(name='ContractTemplateId'),
      invokeType?: string(name='InvokeType'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllBizChainContractResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllBizChainContractResponseBody(name='body'),
}

async function listAllBizChainContractWithOptions(request: ListAllBizChainContractRequest, runtime: Util.RuntimeOptions): ListAllBizChainContractResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainId)) {
    query['BizChainId'] = request.bizChainId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAllBizChainContract',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllBizChainContract(request: ListAllBizChainContractRequest): ListAllBizChainContractResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllBizChainContractWithOptions(request, runtime);
}

model ListAllDeviceGroupResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      deviceGroupId?: string(name='DeviceGroupId'),
      name?: string(name='Name'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllDeviceGroupResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllDeviceGroupResponseBody(name='body'),
}

async function listAllDeviceGroupWithOptions(runtime: Util.RuntimeOptions): ListAllDeviceGroupResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListAllDeviceGroup',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllDeviceGroup(): ListAllDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllDeviceGroupWithOptions(runtime);
}

model ListAllMemberResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      memberId?: string(name='MemberId'),
      name?: string(name='Name'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllMemberResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllMemberResponseBody(name='body'),
}

async function listAllMemberWithOptions(runtime: Util.RuntimeOptions): ListAllMemberResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListAllMember',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllMember(): ListAllMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllMemberWithOptions(runtime);
}

model ListAllPrivacyAlgorithmResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      algImplList?: [ string ](name='AlgImplList'),
      algType?: string(name='AlgType'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllPrivacyAlgorithmResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllPrivacyAlgorithmResponseBody(name='body'),
}

async function listAllPrivacyAlgorithmWithOptions(runtime: Util.RuntimeOptions): ListAllPrivacyAlgorithmResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListAllPrivacyAlgorithm',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllPrivacyAlgorithm(): ListAllPrivacyAlgorithmResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllPrivacyAlgorithmWithOptions(runtime);
}

model ListAllPrivacyRuleResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      name?: string(name='Name'),
      privacyRuleId?: string(name='PrivacyRuleId'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllPrivacyRuleResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllPrivacyRuleResponseBody(name='body'),
}

async function listAllPrivacyRuleWithOptions(runtime: Util.RuntimeOptions): ListAllPrivacyRuleResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListAllPrivacyRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllPrivacyRule(): ListAllPrivacyRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllPrivacyRuleWithOptions(runtime);
}

model ListAllProductKeyResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      name?: string(name='Name'),
      productKey?: string(name='ProductKey'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllProductKeyResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllProductKeyResponseBody(name='body'),
}

async function listAllProductKeyWithOptions(runtime: Util.RuntimeOptions): ListAllProductKeyResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListAllProductKey',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllProductKey(): ListAllProductKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllProductKeyWithOptions(runtime);
}

model ListAllSystemContractRequest {
  blockChainType?: string(name='BlockChainType'),
}

model ListAllSystemContractResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      name?: string(name='Name'),
      systemContractId?: string(name='SystemContractId'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListAllSystemContractResponse = {
  headers: map[string]string(name='headers'),
  body: ListAllSystemContractResponseBody(name='body'),
}

async function listAllSystemContractWithOptions(request: ListAllSystemContractRequest, runtime: Util.RuntimeOptions): ListAllSystemContractResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.blockChainType)) {
    query['BlockChainType'] = request.blockChainType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAllSystemContract',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAllSystemContract(request: ListAllSystemContractRequest): ListAllSystemContractResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAllSystemContractWithOptions(request, runtime);
}

model ListBaaSAntChainRequest {
  baaSAntChainConsortiumId?: string(name='BaaSAntChainConsortiumId'),
}

model ListBaaSAntChainResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      baaSAntChainChainId?: string(name='BaaSAntChainChainId'),
      baaSAntChainChainName?: string(name='BaaSAntChainChainName'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListBaaSAntChainResponse = {
  headers: map[string]string(name='headers'),
  body: ListBaaSAntChainResponseBody(name='body'),
}

async function listBaaSAntChainWithOptions(request: ListBaaSAntChainRequest, runtime: Util.RuntimeOptions): ListBaaSAntChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.baaSAntChainConsortiumId)) {
    query['BaaSAntChainConsortiumId'] = request.baaSAntChainConsortiumId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBaaSAntChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBaaSAntChain(request: ListBaaSAntChainRequest): ListBaaSAntChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBaaSAntChainWithOptions(request, runtime);
}

model ListBaaSAntChainConsortiumResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      baaSAntChainConsortiumId?: string(name='BaaSAntChainConsortiumId'),
      baaSAntChainConsortiumName?: string(name='BaaSAntChainConsortiumName'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListBaaSAntChainConsortiumResponse = {
  headers: map[string]string(name='headers'),
  body: ListBaaSAntChainConsortiumResponseBody(name='body'),
}

async function listBaaSAntChainConsortiumWithOptions(runtime: Util.RuntimeOptions): ListBaaSAntChainConsortiumResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListBaaSAntChainConsortium',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBaaSAntChainConsortium(): ListBaaSAntChainConsortiumResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBaaSAntChainConsortiumWithOptions(runtime);
}

model ListBaaSAntChainPeerRequest {
  baaSAntChainChainId?: string(name='BaaSAntChainChainId'),
  baaSAntChainConsortiumId?: string(name='BaaSAntChainConsortiumId'),
}

model ListBaaSAntChainPeerResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      nodeName?: string(name='NodeName'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListBaaSAntChainPeerResponse = {
  headers: map[string]string(name='headers'),
  body: ListBaaSAntChainPeerResponseBody(name='body'),
}

async function listBaaSAntChainPeerWithOptions(request: ListBaaSAntChainPeerRequest, runtime: Util.RuntimeOptions): ListBaaSAntChainPeerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.baaSAntChainChainId)) {
    query['BaaSAntChainChainId'] = request.baaSAntChainChainId;
  }
  if (!Util.isUnset(request.baaSAntChainConsortiumId)) {
    query['BaaSAntChainConsortiumId'] = request.baaSAntChainConsortiumId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBaaSAntChainPeer',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBaaSAntChainPeer(request: ListBaaSAntChainPeerRequest): ListBaaSAntChainPeerResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBaaSAntChainPeerWithOptions(request, runtime);
}

model ListBaaSFabricChannelRequest {
  baaSFabricConsortiumId?: string(name='BaaSFabricConsortiumId'),
}

model ListBaaSFabricChannelResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      baaSFabricChannelId?: string(name='BaaSFabricChannelId'),
      baaSFabricChannelName?: string(name='BaaSFabricChannelName'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListBaaSFabricChannelResponse = {
  headers: map[string]string(name='headers'),
  body: ListBaaSFabricChannelResponseBody(name='body'),
}

async function listBaaSFabricChannelWithOptions(request: ListBaaSFabricChannelRequest, runtime: Util.RuntimeOptions): ListBaaSFabricChannelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.baaSFabricConsortiumId)) {
    query['BaaSFabricConsortiumId'] = request.baaSFabricConsortiumId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBaaSFabricChannel',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBaaSFabricChannel(request: ListBaaSFabricChannelRequest): ListBaaSFabricChannelResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBaaSFabricChannelWithOptions(request, runtime);
}

model ListBaaSFabricConsortiumResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      baaSFabricConsortiumId?: string(name='BaaSFabricConsortiumId'),
      baaSFabricConsortiumName?: string(name='BaaSFabricConsortiumName'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListBaaSFabricConsortiumResponse = {
  headers: map[string]string(name='headers'),
  body: ListBaaSFabricConsortiumResponseBody(name='body'),
}

async function listBaaSFabricConsortiumWithOptions(runtime: Util.RuntimeOptions): ListBaaSFabricConsortiumResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListBaaSFabricConsortium',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBaaSFabricConsortium(): ListBaaSFabricConsortiumResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBaaSFabricConsortiumWithOptions(runtime);
}

model ListBaaSFabricOrganizationRequest {
  baaSFabricChannelId?: string(name='BaaSFabricChannelId'),
}

model ListBaaSFabricOrganizationResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      baaSFabricOrganizationId?: string(name='BaaSFabricOrganizationId'),
      baaSFabricOrganizationName?: string(name='BaaSFabricOrganizationName'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListBaaSFabricOrganizationResponse = {
  headers: map[string]string(name='headers'),
  body: ListBaaSFabricOrganizationResponseBody(name='body'),
}

async function listBaaSFabricOrganizationWithOptions(request: ListBaaSFabricOrganizationRequest, runtime: Util.RuntimeOptions): ListBaaSFabricOrganizationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.baaSFabricChannelId)) {
    query['BaaSFabricChannelId'] = request.baaSFabricChannelId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBaaSFabricOrganization',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBaaSFabricOrganization(request: ListBaaSFabricOrganizationRequest): ListBaaSFabricOrganizationResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBaaSFabricOrganizationWithOptions(request, runtime);
}

model ListBizChainRequest {
  bizChainId?: string(name='BizChainId'),
  name?: string(name='Name'),
  num?: int32(name='Num'),
  size?: int32(name='Size'),
}

model ListBizChainResponseBody = {
  code?: string(name='Code'),
  data?: {
    num?: int32(name='Num'),
    pageData?: [ 
      {
        bizChainId?: string(name='BizChainId'),
        name?: string(name='Name'),
        remark?: string(name='Remark'),
        type?: string(name='Type'),
      }
    ](name='PageData'),
    size?: int32(name='Size'),
    total?: int32(name='Total'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: ListBizChainResponseBody(name='body'),
}

async function listBizChainWithOptions(request: ListBizChainRequest, runtime: Util.RuntimeOptions): ListBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainId)) {
    query['BizChainId'] = request.bizChainId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.num)) {
    query['Num'] = request.num;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBizChain(request: ListBizChainRequest): ListBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBizChainWithOptions(request, runtime);
}

model ListBizChainDataRequest {
  bizChainId?: string(name='BizChainId'),
  endTime?: long(name='EndTime'),
  ioTDataDID?: string(name='IoTDataDID'),
  memberId?: string(name='MemberId'),
  num?: int32(name='Num'),
  size?: int32(name='Size'),
  startTime?: long(name='StartTime'),
}

model ListBizChainDataResponseBody = {
  code?: string(name='Code'),
  data?: {
    num?: int32(name='Num'),
    pageData?: [ 
      {
        blockHash?: string(name='BlockHash'),
        blockNum?: string(name='BlockNum'),
        deviceName?: string(name='DeviceName'),
        memberName?: string(name='MemberName'),
        productKey?: string(name='ProductKey'),
        timestamp?: long(name='Timestamp'),
        txHash?: string(name='TxHash'),
      }
    ](name='PageData'),
    size?: int32(name='Size'),
    total?: int32(name='Total'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListBizChainDataResponse = {
  headers: map[string]string(name='headers'),
  body: ListBizChainDataResponseBody(name='body'),
}

async function listBizChainDataWithOptions(request: ListBizChainDataRequest, runtime: Util.RuntimeOptions): ListBizChainDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainId)) {
    query['BizChainId'] = request.bizChainId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ioTDataDID)) {
    query['IoTDataDID'] = request.ioTDataDID;
  }
  if (!Util.isUnset(request.memberId)) {
    query['MemberId'] = request.memberId;
  }
  if (!Util.isUnset(request.num)) {
    query['Num'] = request.num;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListBizChainData',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listBizChainData(request: ListBizChainDataRequest): ListBizChainDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return listBizChainDataWithOptions(request, runtime);
}

model ListDeviceRequest {
  deviceGroupId?: string(name='DeviceGroupId'),
  name?: string(name='Name'),
  num?: int32(name='Num'),
  size?: int32(name='Size'),
}

model ListDeviceResponseBody = {
  code?: string(name='Code'),
  data?: {
    num?: int32(name='Num'),
    pageData?: [ 
      {
        deviceId?: string(name='DeviceId'),
        lastOnchainTime?: string(name='LastOnchainTime'),
        name?: string(name='Name'),
        status?: string(name='Status'),
        usedOnchainCount?: long(name='UsedOnchainCount'),
      }
    ](name='PageData'),
    size?: int32(name='Size'),
    total?: int32(name='Total'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListDeviceResponse = {
  headers: map[string]string(name='headers'),
  body: ListDeviceResponseBody(name='body'),
}

async function listDeviceWithOptions(request: ListDeviceRequest, runtime: Util.RuntimeOptions): ListDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.num)) {
    query['Num'] = request.num;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDevice',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDevice(request: ListDeviceRequest): ListDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDeviceWithOptions(request, runtime);
}

model ListDeviceGroupRequest {
  memberName?: string(name='MemberName'),
  name?: string(name='Name'),
  num?: int32(name='Num'),
  size?: int32(name='Size'),
  status?: string(name='Status'),
}

model ListDeviceGroupResponseBody = {
  code?: string(name='Code'),
  data?: {
    num?: int32(name='Num'),
    pageData?: [ 
      {
        currentUser?: boolean(name='CurrentUser'),
        deviceCount?: long(name='DeviceCount'),
        deviceGroupId?: string(name='DeviceGroupId'),
        memberName?: string(name='MemberName'),
        name?: string(name='Name'),
        productKey?: string(name='ProductKey'),
        remark?: string(name='Remark'),
        status?: string(name='Status'),
      }
    ](name='PageData'),
    size?: int32(name='Size'),
    total?: int32(name='Total'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListDeviceGroupResponse = {
  headers: map[string]string(name='headers'),
  body: ListDeviceGroupResponseBody(name='body'),
}

async function listDeviceGroupWithOptions(request: ListDeviceGroupRequest, runtime: Util.RuntimeOptions): ListDeviceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.memberName)) {
    query['MemberName'] = request.memberName;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.num)) {
    query['Num'] = request.num;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDeviceGroup',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDeviceGroup(request: ListDeviceGroupRequest): ListDeviceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDeviceGroupWithOptions(request, runtime);
}

model ListDeviceGroupAuthorizedBizChainRequest {
  deviceGroupId?: string(name='DeviceGroupId'),
}

model ListDeviceGroupAuthorizedBizChainResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      authorized?: boolean(name='Authorized'),
      bizChainId?: string(name='BizChainId'),
      bizChainName?: string(name='BizChainName'),
      blockChainType?: string(name='BlockChainType'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListDeviceGroupAuthorizedBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: ListDeviceGroupAuthorizedBizChainResponseBody(name='body'),
}

async function listDeviceGroupAuthorizedBizChainWithOptions(request: ListDeviceGroupAuthorizedBizChainRequest, runtime: Util.RuntimeOptions): ListDeviceGroupAuthorizedBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceGroupId)) {
    query['DeviceGroupId'] = request.deviceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDeviceGroupAuthorizedBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDeviceGroupAuthorizedBizChain(request: ListDeviceGroupAuthorizedBizChainRequest): ListDeviceGroupAuthorizedBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDeviceGroupAuthorizedBizChainWithOptions(request, runtime);
}

model ListMemberRequest {
  contactor?: string(name='Contactor'),
  name?: string(name='Name'),
  num?: int32(name='Num'),
  size?: int32(name='Size'),
  uid?: string(name='Uid'),
}

model ListMemberResponseBody = {
  code?: string(name='Code'),
  data?: {
    num?: int32(name='Num'),
    pageData?: [ 
      {
        adminName?: string(name='AdminName'),
        authorizedCount?: long(name='AuthorizedCount'),
        contactor?: string(name='Contactor'),
        memberId?: string(name='MemberId'),
        name?: string(name='Name'),
        remark?: string(name='Remark'),
        status?: string(name='Status'),
        telephony?: string(name='Telephony'),
        uid?: string(name='Uid'),
      }
    ](name='PageData'),
    size?: int32(name='Size'),
    total?: int32(name='Total'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListMemberResponse = {
  headers: map[string]string(name='headers'),
  body: ListMemberResponseBody(name='body'),
}

async function listMemberWithOptions(request: ListMemberRequest, runtime: Util.RuntimeOptions): ListMemberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactor)) {
    query['Contactor'] = request.contactor;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.num)) {
    query['Num'] = request.num;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMember',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listMember(request: ListMemberRequest): ListMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMemberWithOptions(request, runtime);
}

model ListMemberAccessRecordRequest {
  accessStatus?: string(name='AccessStatus'),
  contactor?: string(name='Contactor'),
  name?: string(name='Name'),
  num?: long(name='Num'),
  size?: long(name='Size'),
  uid?: string(name='Uid'),
}

model ListMemberAccessRecordResponseBody = {
  code?: string(name='Code'),
  data?: {
    num?: int32(name='Num'),
    pageData?: [ 
      {
        accessDate?: long(name='AccessDate'),
        accessStatus?: string(name='AccessStatus'),
        adminName?: string(name='AdminName'),
        authorizedCount?: long(name='AuthorizedCount'),
        contactor?: string(name='Contactor'),
        memberId?: string(name='MemberId'),
        memberResponseDate?: long(name='MemberResponseDate'),
        name?: string(name='Name'),
        remark?: string(name='Remark'),
        status?: string(name='Status'),
        telephony?: string(name='Telephony'),
        uid?: string(name='Uid'),
      }
    ](name='PageData'),
    size?: int32(name='Size'),
    total?: int32(name='Total'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListMemberAccessRecordResponse = {
  headers: map[string]string(name='headers'),
  body: ListMemberAccessRecordResponseBody(name='body'),
}

async function listMemberAccessRecordWithOptions(request: ListMemberAccessRecordRequest, runtime: Util.RuntimeOptions): ListMemberAccessRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessStatus)) {
    query['AccessStatus'] = request.accessStatus;
  }
  if (!Util.isUnset(request.contactor)) {
    query['Contactor'] = request.contactor;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.num)) {
    query['Num'] = request.num;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMemberAccessRecord',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listMemberAccessRecord(request: ListMemberAccessRecordRequest): ListMemberAccessRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMemberAccessRecordWithOptions(request, runtime);
}

model ListMemberAuthorizedBizChainRequest {
  memberId?: string(name='MemberId'),
}

model ListMemberAuthorizedBizChainResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      authorized?: boolean(name='Authorized'),
      bizChainId?: string(name='BizChainId'),
      bizChainName?: string(name='BizChainName'),
      bizChainType?: string(name='BizChainType'),
      peerList?: [ 
        {
          authorized?: boolean(name='Authorized'),
          peerName?: string(name='PeerName'),
        }
      ](name='PeerList'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListMemberAuthorizedBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: ListMemberAuthorizedBizChainResponseBody(name='body'),
}

async function listMemberAuthorizedBizChainWithOptions(request: ListMemberAuthorizedBizChainRequest, runtime: Util.RuntimeOptions): ListMemberAuthorizedBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.memberId)) {
    query['MemberId'] = request.memberId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMemberAuthorizedBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listMemberAuthorizedBizChain(request: ListMemberAuthorizedBizChainRequest): ListMemberAuthorizedBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return listMemberAuthorizedBizChainWithOptions(request, runtime);
}

model ListPrivacyRuleRequest {
  num?: int32(name='Num'),
  size?: int32(name='Size'),
}

model ListPrivacyRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    num?: int32(name='Num'),
    pageData?: [ 
      {
        algImpl?: string(name='AlgImpl'),
        algType?: string(name='AlgType'),
        currentUser?: boolean(name='CurrentUser'),
        memberName?: string(name='MemberName'),
        name?: string(name='Name'),
        privacyRuleId?: string(name='PrivacyRuleId'),
        remark?: string(name='Remark'),
        status?: string(name='Status'),
      }
    ](name='PageData'),
    size?: int32(name='Size'),
    total?: int32(name='Total'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListPrivacyRuleResponse = {
  headers: map[string]string(name='headers'),
  body: ListPrivacyRuleResponseBody(name='body'),
}

async function listPrivacyRuleWithOptions(request: ListPrivacyRuleRequest, runtime: Util.RuntimeOptions): ListPrivacyRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.num)) {
    query['Num'] = request.num;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPrivacyRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listPrivacyRule(request: ListPrivacyRuleRequest): ListPrivacyRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPrivacyRuleWithOptions(request, runtime);
}

model ListPrivacyRuleSharedMemberRequest {
  privacyRuleId?: string(name='PrivacyRuleId'),
}

model ListPrivacyRuleSharedMemberResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bizChainId?: string(name='BizChainId'),
      bizChainName?: string(name='BizChainName'),
      memberList?: [ 
        {
          memberId?: string(name='MemberId'),
          memberName?: string(name='MemberName'),
          shared?: string(name='Shared'),
        }
      ](name='MemberList'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListPrivacyRuleSharedMemberResponse = {
  headers: map[string]string(name='headers'),
  body: ListPrivacyRuleSharedMemberResponseBody(name='body'),
}

async function listPrivacyRuleSharedMemberWithOptions(request: ListPrivacyRuleSharedMemberRequest, runtime: Util.RuntimeOptions): ListPrivacyRuleSharedMemberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.privacyRuleId)) {
    query['PrivacyRuleId'] = request.privacyRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPrivacyRuleSharedMember',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listPrivacyRuleSharedMember(request: ListPrivacyRuleSharedMemberRequest): ListPrivacyRuleSharedMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPrivacyRuleSharedMemberWithOptions(request, runtime);
}

model ListRouteRuleRequest {
  bizChainName?: string(name='BizChainName'),
  deviceGroupName?: string(name='DeviceGroupName'),
  num?: int32(name='Num'),
  size?: int32(name='Size'),
}

model ListRouteRuleResponseBody = {
  code?: string(name='Code'),
  data?: {
    num?: int32(name='Num'),
    pageData?: [ 
      {
        bizChainId?: long(name='BizChainId'),
        bizChainName?: string(name='BizChainName'),
        blockChainType?: string(name='BlockChainType'),
        contractName?: string(name='ContractName'),
        contractTemplateId?: string(name='ContractTemplateId'),
        deviceGroupId?: string(name='DeviceGroupId'),
        deviceGroupName?: string(name='DeviceGroupName'),
        invokeType?: string(name='InvokeType'),
        privacyRuleId?: string(name='PrivacyRuleId'),
        privacyRuleName?: string(name='PrivacyRuleName'),
        remark?: string(name='Remark'),
        routeRuleId?: string(name='RouteRuleId'),
      }
    ](name='PageData'),
    size?: int32(name='Size'),
    total?: int32(name='Total'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListRouteRuleResponse = {
  headers: map[string]string(name='headers'),
  body: ListRouteRuleResponseBody(name='body'),
}

async function listRouteRuleWithOptions(request: ListRouteRuleRequest, runtime: Util.RuntimeOptions): ListRouteRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainName)) {
    query['BizChainName'] = request.bizChainName;
  }
  if (!Util.isUnset(request.deviceGroupName)) {
    query['DeviceGroupName'] = request.deviceGroupName;
  }
  if (!Util.isUnset(request.num)) {
    query['Num'] = request.num;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRouteRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRouteRule(request: ListRouteRuleRequest): ListRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRouteRuleWithOptions(request, runtime);
}

model QueryBlockchainDataRequest {
  bizChainId?: string(name='BizChainId'),
  iotDataDID?: string(name='IotDataDID'),
}

model QueryBlockchainDataResponseBody = {
  code?: string(name='Code'),
  data?: {
    plainData?: string(name='PlainData'),
    privacyData?: string(name='PrivacyData'),
    privacyRuleId?: string(name='PrivacyRuleId'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryBlockchainDataResponse = {
  headers: map[string]string(name='headers'),
  body: QueryBlockchainDataResponseBody(name='body'),
}

async function queryBlockchainDataWithOptions(request: QueryBlockchainDataRequest, runtime: Util.RuntimeOptions): QueryBlockchainDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainId)) {
    query['BizChainId'] = request.bizChainId;
  }
  if (!Util.isUnset(request.iotDataDID)) {
    query['IotDataDID'] = request.iotDataDID;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryBlockchainData',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryBlockchainData(request: QueryBlockchainDataRequest): QueryBlockchainDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBlockchainDataWithOptions(request, runtime);
}

model QueryBlockchainMetadataRequest {
  bizChainId?: string(name='BizChainId'),
  iotDataDID?: string(name='IotDataDID'),
}

model QueryBlockchainMetadataResponseBody = {
  code?: string(name='Code'),
  data?: {
    blockHash?: string(name='BlockHash'),
    blockNumber?: string(name='BlockNumber'),
    iotId?: string(name='IotId'),
    memberName?: string(name='MemberName'),
    productKey?: string(name='ProductKey'),
    timestamp?: long(name='Timestamp'),
    txHash?: string(name='TxHash'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryBlockchainMetadataResponse = {
  headers: map[string]string(name='headers'),
  body: QueryBlockchainMetadataResponseBody(name='body'),
}

async function queryBlockchainMetadataWithOptions(request: QueryBlockchainMetadataRequest, runtime: Util.RuntimeOptions): QueryBlockchainMetadataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainId)) {
    query['BizChainId'] = request.bizChainId;
  }
  if (!Util.isUnset(request.iotDataDID)) {
    query['IotDataDID'] = request.iotDataDID;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryBlockchainMetadata',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryBlockchainMetadata(request: QueryBlockchainMetadataRequest): QueryBlockchainMetadataResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBlockchainMetadataWithOptions(request, runtime);
}

model SharePrivacyRuleRequest {
  memberIdList?: string(name='MemberIdList'),
  privacyRuleId?: string(name='PrivacyRuleId'),
}

model SharePrivacyRuleResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SharePrivacyRuleResponse = {
  headers: map[string]string(name='headers'),
  body: SharePrivacyRuleResponseBody(name='body'),
}

async function sharePrivacyRuleWithOptions(request: SharePrivacyRuleRequest, runtime: Util.RuntimeOptions): SharePrivacyRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.memberIdList)) {
    query['MemberIdList'] = request.memberIdList;
  }
  if (!Util.isUnset(request.privacyRuleId)) {
    query['PrivacyRuleId'] = request.privacyRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SharePrivacyRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sharePrivacyRule(request: SharePrivacyRuleRequest): SharePrivacyRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return sharePrivacyRuleWithOptions(request, runtime);
}

model UnFreezeMemberRequest {
  memberId?: string(name='MemberId'),
}

model UnFreezeMemberResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UnFreezeMemberResponse = {
  headers: map[string]string(name='headers'),
  body: UnFreezeMemberResponseBody(name='body'),
}

async function unFreezeMemberWithOptions(request: UnFreezeMemberRequest, runtime: Util.RuntimeOptions): UnFreezeMemberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.memberId)) {
    query['MemberId'] = request.memberId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnFreezeMember',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unFreezeMember(request: UnFreezeMemberRequest): UnFreezeMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return unFreezeMemberWithOptions(request, runtime);
}

model UpdateBizChainRequest {
  bizChainId?: string(name='BizChainId'),
  name?: string(name='Name'),
  remark?: string(name='Remark'),
}

model UpdateBizChainResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateBizChainResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateBizChainResponseBody(name='body'),
}

async function updateBizChainWithOptions(request: UpdateBizChainRequest, runtime: Util.RuntimeOptions): UpdateBizChainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainId)) {
    query['BizChainId'] = request.bizChainId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateBizChain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateBizChain(request: UpdateBizChainRequest): UpdateBizChainResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateBizChainWithOptions(request, runtime);
}

model UpdateMemberRequest {
  authorizedCount?: long(name='AuthorizedCount'),
  contactor?: string(name='Contactor'),
  memberId?: string(name='MemberId'),
  name?: string(name='Name'),
  remark?: string(name='Remark'),
  telephony?: string(name='Telephony'),
  uid?: string(name='Uid'),
}

model UpdateMemberResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateMemberResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateMemberResponseBody(name='body'),
}

async function updateMemberWithOptions(request: UpdateMemberRequest, runtime: Util.RuntimeOptions): UpdateMemberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizedCount)) {
    query['AuthorizedCount'] = request.authorizedCount;
  }
  if (!Util.isUnset(request.contactor)) {
    query['Contactor'] = request.contactor;
  }
  if (!Util.isUnset(request.memberId)) {
    query['MemberId'] = request.memberId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.telephony)) {
    query['Telephony'] = request.telephony;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMember',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMember(request: UpdateMemberRequest): UpdateMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMemberWithOptions(request, runtime);
}

model UpdatePrivacyRuleRequest {
  algImpl?: string(name='AlgImpl'),
  algType?: string(name='AlgType'),
  name?: string(name='Name'),
  privacyRuleId?: string(name='PrivacyRuleId'),
  remark?: string(name='Remark'),
}

model UpdatePrivacyRuleResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdatePrivacyRuleResponse = {
  headers: map[string]string(name='headers'),
  body: UpdatePrivacyRuleResponseBody(name='body'),
}

async function updatePrivacyRuleWithOptions(request: UpdatePrivacyRuleRequest, runtime: Util.RuntimeOptions): UpdatePrivacyRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.algImpl)) {
    query['AlgImpl'] = request.algImpl;
  }
  if (!Util.isUnset(request.algType)) {
    query['AlgType'] = request.algType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.privacyRuleId)) {
    query['PrivacyRuleId'] = request.privacyRuleId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePrivacyRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updatePrivacyRule(request: UpdatePrivacyRuleRequest): UpdatePrivacyRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePrivacyRuleWithOptions(request, runtime);
}

model UpdateRouteRuleRequest {
  bizChainId?: string(name='BizChainId'),
  contractName?: string(name='ContractName'),
  contractTemplateId?: string(name='ContractTemplateId'),
  invokeType?: string(name='InvokeType'),
  privacyRuleId?: string(name='PrivacyRuleId'),
  remark?: string(name='Remark'),
  routeRuleId?: string(name='RouteRuleId'),
}

model UpdateRouteRuleResponseBody = {
  code?: string(name='Code'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateRouteRuleResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateRouteRuleResponseBody(name='body'),
}

async function updateRouteRuleWithOptions(request: UpdateRouteRuleRequest, runtime: Util.RuntimeOptions): UpdateRouteRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizChainId)) {
    query['BizChainId'] = request.bizChainId;
  }
  if (!Util.isUnset(request.contractName)) {
    query['ContractName'] = request.contractName;
  }
  if (!Util.isUnset(request.contractTemplateId)) {
    query['ContractTemplateId'] = request.contractTemplateId;
  }
  if (!Util.isUnset(request.invokeType)) {
    query['InvokeType'] = request.invokeType;
  }
  if (!Util.isUnset(request.privacyRuleId)) {
    query['PrivacyRuleId'] = request.privacyRuleId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.routeRuleId)) {
    query['RouteRuleId'] = request.routeRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRouteRule',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateRouteRule(request: UpdateRouteRuleRequest): UpdateRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRouteRuleWithOptions(request, runtime);
}

model UploadIoTDataToBlockchainRequest {
  iotAuthType?: string(name='IotAuthType'),
  iotDataDID?: string(name='IotDataDID'),
  iotDataDigest?: string(name='IotDataDigest'),
  iotDataToken?: string(name='IotDataToken'),
  iotId?: string(name='IotId'),
  iotIdServiceProvider?: string(name='IotIdServiceProvider'),
  iotIdSource?: string(name='IotIdSource'),
  plainData?: string(name='PlainData'),
  privacyData?: string(name='PrivacyData'),
}

model UploadIoTDataToBlockchainResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UploadIoTDataToBlockchainResponse = {
  headers: map[string]string(name='headers'),
  body: UploadIoTDataToBlockchainResponseBody(name='body'),
}

async function uploadIoTDataToBlockchainWithOptions(request: UploadIoTDataToBlockchainRequest, runtime: Util.RuntimeOptions): UploadIoTDataToBlockchainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.iotAuthType)) {
    query['IotAuthType'] = request.iotAuthType;
  }
  if (!Util.isUnset(request.iotDataDID)) {
    query['IotDataDID'] = request.iotDataDID;
  }
  if (!Util.isUnset(request.iotDataDigest)) {
    query['IotDataDigest'] = request.iotDataDigest;
  }
  if (!Util.isUnset(request.iotDataToken)) {
    query['IotDataToken'] = request.iotDataToken;
  }
  if (!Util.isUnset(request.iotId)) {
    query['IotId'] = request.iotId;
  }
  if (!Util.isUnset(request.iotIdServiceProvider)) {
    query['IotIdServiceProvider'] = request.iotIdServiceProvider;
  }
  if (!Util.isUnset(request.iotIdSource)) {
    query['IotIdSource'] = request.iotIdSource;
  }
  if (!Util.isUnset(request.plainData)) {
    query['PlainData'] = request.plainData;
  }
  if (!Util.isUnset(request.privacyData)) {
    query['PrivacyData'] = request.privacyData;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UploadIoTDataToBlockchain',
    version = '2021-07-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function uploadIoTDataToBlockchain(request: UploadIoTDataToBlockchainRequest): UploadIoTDataToBlockchainResponse {
  var runtime = new Util.RuntimeOptions{};
  return uploadIoTDataToBlockchainWithOptions(request, runtime);
}

